-
-
Notifications
You must be signed in to change notification settings - Fork 24
Add support for years (y), months (M), and weeks (w) time units to TimeUnit parser #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
…ive tests Co-authored-by: niemyjski <[email protected]>
Copilot finished work on behalf of
niemyjski
September 22, 2025 04:28
niemyjski
reviewed
Sep 22, 2025
niemyjski
reviewed
Sep 22, 2025
… values consistently, and add comprehensive whitespace/special character tests Co-authored-by: niemyjski <[email protected]>
…onvention, improve AAA pattern, and simplify test logic Co-authored-by: niemyjski <[email protected]>
Copilot finished work on behalf of
niemyjski
September 22, 2025 13:58
niemyjski
reviewed
Sep 22, 2025
niemyjski
reviewed
Sep 22, 2025
niemyjski
reviewed
Sep 22, 2025
niemyjski
reviewed
Sep 22, 2025
niemyjski
reviewed
Sep 22, 2025
Apply suggestion from @niemyjski Apply suggestion from @niemyjski Apply suggestion from @niemyjski Apply suggestion from @niemyjski ran dotnet format
7092fa6
to
934ecb9
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
MethodName_StateUnderTest_ExpectedBehavior
naming conventionSummary
Successfully implemented support for Elasticsearch-compatible time units (y, M, w) in the TimeUnit parser with improved robustness and comprehensive test coverage following established best practices.
Latest Improvements (addressing @niemyjski testing best practices feedback):
MethodName_StateUnderTest_ExpectedBehavior
patternParse_UppercaseM_ParsesAsMonths()
- Tests uppercase M for monthsParse_LowercaseM_ParsesAsMinutes()
- Tests lowercase m for minutesParse_MonthsAndMinutes_ProduceDifferentResults()
- Verifies case sensitivityParse_YearUnit_ReturnsExpectedDays()
- Dedicated year unit testingParse_MonthUnit_ReturnsExpectedDays()
- Dedicated month unit testingParse_WeekUnit_ReturnsExpectedDays()
- Dedicated week unit testingPreviously Completed Improvements:
EndsWith
checks now use normalized (trimmed) valuesKey Features Added:
TimeSpanExtensions.AvgDaysInAYear
(365.2425 days)TimeSpanExtensions.AvgDaysInAMonth
(30.436875 days)Implementation Details:
TimeUnit.ParseTime
method with improved validationTimeSpanExtensions
for consistencyTesting:
MethodName_StateUnderTest_ExpectedBehavior
conventionThe implementation aligns with Elasticsearch time unit conventions and integrates seamlessly with the existing DateMath functionality.
Fixes #2.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.